<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List"%>
<%@ page import="activity.Activity_supply"%>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="javax.jdo.Query" %>
<%@ page import="activity.PMF" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>需求點數</title>
<style type="text/css">
.title {
	font-size: 70px;
	font-weight: bolder;
	color: #000;
}
.tabletit {
	font-size: 36px;
	color: #000;
	border-top-color: #000;
	border-right-color: #000;
	border-bottom-color: #000;
	border-left-color: #000;
	text-decoration: none;
	text-align: center;
}
body {
	background-color: #99C;
	text-align: center;
}

a {text-decoration: none;
	 color: #930;
}  


.tblCon {
	font-size: 16px;
	font-weight: bold;
	color: #000;
	text-decoration: none;
	text-align: center;
}
.accept {
	font-size: 16px;
	color: #930;
	text-decoration: none;
}
.inv {
	font-size: 24px;
	color: #FC0;
	text-decoration: none;
}
</style></head>


<body>
<%
PersistenceManager pm = PMF.get().getPersistenceManager();
Query query = pm.newQuery(Activity_supply.class,"(actShop_s == '全家'"+" && actName_s == '積木')");

//query.setFilter("inventory >= reorderPoint"); //DOES NOT WORK
//query.setOrdering("hireDate desc");
//query.declareParameters("String lastNameParam");

try {
	
	
    List<Activity_supply> results = (List<Activity_supply>) query.execute();
    
%>

<table width="1038" height="667" border="0" align="center">
  <tr>
    <th height="188" colspan="3" rowspan="2" class="title" scope="col"><p>全家</p></th>
    <th height="188" colspan="2" scope="col">Welcome</th>
  </tr>
  <tr>
    <td><p><a href="index_un.jsp" class="accept">回首頁</a></p></td>
  </tr>
  <tr>
    <th colspan="3" scope="row">&nbsp;</th>
    <td class="accept"><a href="upload.jsp">我要上架</a></td>
    
  </tr>
  <tr>
    <th height="133" colspan="6" class="tabletit" scope="row">現有活動</th>
  </tr>
  <tr>
    <th height="21" colspan="6" bgcolor="#000000" scope="row">&nbsp;</th>
  </tr>
<tr>
  <th height="53" colspan="2" class="tblCon" scope="row"><span class="inv"><a href="activityFam.jsp" class="inv">需求</a></span></th>
  <th height="53" colspan="5" bgcolor="#993300" class="tblCon" scope="row"><a class="inv">提供</a></th>
  </tr>
<tr>
  <th width="239" height="53" class="tblCon" scope="row">提供活動數量</th>
  <th width="144" class="tblCon" scope="row">需求活動點數</th>
  <th width="137" class="tblCon" scope="row">發起日期</th>
  <th width="137" class="tblCon" scope="row">截止日期</th>
  <th width="101" height="53" class="tblCon" scope="row">發起者</th>
  <th height="53" colspan="2" scope="row"><span class="tblCon"></span></th>
</tr>


 
 
  


  <%
        
  		if (!results.isEmpty()) {            
            for (Activity_supply act : results) {
                		 
        	
%>
				
				<tr>
                <td><%=act.getActName_s() %>_<%=act.getActPoint_s() %>點</td>
				<td width="212"><%=act.getActName_d() %>_<%=act.getActPoint_d() %>點</td>
				<td><%=act.getActStart_s() %></td>
				<td><%=act.getActEnd_s() %></td>
                <td><%=act.getUserName_s() %></td>
                
				
				<th height="58" class="accept" scope="row"><p class="accept"><a href="invitePage.jsp">邀請</a></p></th>
				
				
				
				</tr>
<% 
                 
                 
                 }
  
				}else{
					%>
					<tr>
					<td>找無資料!!!!</td>
					
					</tr>
					<%
                   	 }
        	
        	
        
		
    		
}//try
finally {
    query.closeAll();
}

%>

</table>

</body>
</html>
